<?php
class Cys_Db {
	private static $instance;
	private $db_user;
	private $db_password;
	private $db_name;
	/**
	 *
	 * @return the $db_user
	 */
	public function getDb_user() {
		return $this->db_user;
	}
	
	/**
	 *
	 * @return the $db_password
	 */
	public function getDb_password() {
		return $this->db_password;
	}
	
	/**
	 *
	 * @return the $db_name
	 */
	public function getDb_name() {
		return $this->db_name;
	}
	
	/**
	 *
	 * @param $db_user field_type       	
	 */
	public function setDb_user($db_user) {
		$this->db_user = $db_user;
	}
	
	/**
	 *
	 * @param $db_password field_type       	
	 */
	public function setDb_password($db_password) {
		$this->db_password = $db_password;
	}
	
	/**
	 *
	 * @param $db_name field_type       	
	 */
	public function setDb_name($db_name) {
		$this->db_name = $db_name;
	}
	
	private function __construct() {
	
	}
	
	public static function getInstance() {
		if (self::$instance == null) {
			
			self::$instance = new Cys_Db ();
		}
		return self::$instance;
	}
	
	public function connect_To_Db() {
		$con = mysql_connect ( $this->getDb_name (), $this->getDb_user (), $this->getDb_password () );
		if (! $con) {
			die ( 'Could not connect: ' . mysql_error () );
		}
		else 
			echo 'is connected...';
	
	}
	
	public function close_To_Db($con) {
		mysql_close ( $con );
	
	}
}

?>